<template>
  <div>
    <div class="biaoqian">
      <h3>标签</h3>
      <el-tag v-for="item in tagList" :key="item.id" @click="jumpThree(item.id,item.name)">{{ item.name }}</el-tag>
    </div>
  </div>
</template>

<script>
export default {
  created() {
    this.seek();
    this.tagPost();
  },
  data() {
    return {
      tagList: [],
    };
  },
  methods: {
    jumpThree(a,b) {
      this.$router.push({
        name: "threeChild", //用params时此处只能用name跳转
        query: {
          tagId: a,
          text: b,
        },
      });
    },
    seek() {
      this.$emit("back", [false, false]);
    },
    //标签
    tagPost() {
      this.$axios.post("http://47.104.167.34:9110/api/tag/list").then((res) => {
        this.tagList = res.data.data;
        console.log(res, "11110000222");
      });
    },
  },
};
</script>

<style scoped>
.biaoqian {
  padding: 10px;
  background-color: white;
}
.el-tag {
  margin: 8px 20px 8px 0px;
}
</style>